home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c
- Subject: Re: Link list Vs Memory block
- Date: 16 Feb 1996 15:57:38 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Feb16085738@qcd.lanl.gov>
- References: <4g0r86$fk5@netnews.upenn.edu>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: skramiah@gradine.cis.upenn.edu's message of 16 Feb 1996 02:47:34 GMT
-
- In article <4g0r86$fk5@netnews.upenn.edu>
- skramiah@gradine.cis.upenn.edu (Senthil K. Ramiah) writes:
- <snip>
- struct struct_s
- {
- int i;
- char c;
- };
- main()
- {
- struct struct_s *s1;
-
- s1 = malloc(sizeof(struct struct_s) * 2);
-
- s1->i =1; s1->c ='a';
- s1++;
- s1->i =2; s1->c = 'b';
- }
-
- My questions are:
-
- 1) How safe is it to use the above method
- instead of a link list.
-
- An array is as safe as a linked list. They serve different purposes
- though.
-
- 2) Will this implementation work on all platforms.
-
- Why not?
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-